import { serverBase } from '@/axios/index';

/**
 * 登陆
 * @param data
 * @returns {Promise<void>}
 */
export const postLogin = (data = {}) => serverBase.post('/sys/auth/v1/login/pwd', data, { loading: true });
/**
 * 图形验证码
 * @param data
 * @returns {Promise<void>}
 */
export const postImgCode = (data = {}) => serverBase.post('/sys/auth/v1/kaptcha/image', data, { loading: true });
/**
 * 获取ras加密的key
 * @param data
 * @returns {Promise<void>}
 */
 export const postRsaKey = (data = {}) => serverBase.post('/auth/public/key', data);
// /**
//  * 用户信息
//  * @param data
//  * @returns {Promise<void>}
//  */
//  export const userInfo = (data = {}) => serverBase.post('/auth/login/info', data, { loading: true });

 /**
 * 查询登录账号信息
 * @param data
 * @returns {Promise<void>}
 */
export const postUserInfo = (data = {}) => serverBase.post('/sys/user/v1/info', data, { loading: true });
/**
 * 退出登陆
 * @param data
 * @returns {Promise<void>}
 */
export const postLogout = (data = {}) => serverBase.post('/sys/auth/v1/logout', data, { loading: true });
/**
 * 重置密码
 * @param data
 * @returns {Promise<void>}
 */
export const postResetPwd = (data = {}) => serverBase.post('/sys/auth/v1/reset/pwd', data, { loading: true });

/**
 * 查询用户菜单权限列表
 * @param data
 * @returns {Promise<void>}
 */
 export const postSysPermissionTree = (data = {}) => serverBase.post('/sys/menu/v1/permission/tree/list', data, { loading: true });
